Source: https://files.axds.co/portals/sanctsound/plots/manifest.html by Brian Stone brian@axiomdatascience.com
Files, per NCEI products Readme.docx:
SanctSound_CI01_01_BB_1h.csv Channel Islands NMS, site 1, deployment 1, Broadband Sound Pressure Level, hourlySanctSound_CI01_01_OL_1h.csv Channel Islands NMS, site 1, deployment 1, Octave Level, hourlySanctSound_CI01_01_PSD_1h.csv Channel Islands NMS, site 1, deployment 1, Power Spectral Density, hourlylibrary(readr)
library(dplyr)
library(tidyr)
library(purrr)
library(here)
library(DT)
# install.packages("ggplot2movies")
csvs <- list(
bb = here("data/SanctSound_CI01_01_BB_1h.csv"),
ol = here("data/SanctSound_CI01_01_OL_1h.csv"),
psd = here("data/SanctSound_CI01_01_PSD_1h.csv"))
d <- map(csvs, read_csv)
d_smry <- tibble(
dataset = names(d),
cols = map(dataset, function(x) names(d[[x]])),
cols13 = map_chr(cols, function(x) paste(x[1:min(length(x),13)], collapse = ",")),
dim = map_chr(dataset, function(x) paste(dim(d[[x]]), collapse = " x ")))
d_smry %>%
select(dataset, dim, cols13) %>%
datatable()
ol <- d[["ol"]] %>%
rename(hour = `yyyy-mm-ddTHH:MM:SSZ`) %>%
select(-X13) %>%
pivot_longer(-hour, names_to = "octave", values_to = "level") %>%
mutate(
hour_int = as.double(hour - min(hour), units = "hours") %>%
as.integer(),
level_int = as.integer(level))
ol %>%
head(1000) %>%
datatable()
data(movies, package = "ggplot2movies")
movies_long <- movies %>%
dplyr::select(year, Action, Animation, Comedy, Drama, Documentary, Romance, Short) %>%
tidyr::gather(genre, value, -year) %>%
group_by(year, genre) %>%
summarise(n = sum(value)) %>%
ungroup()
movies_long %>%
head(1000) %>%
datatable()
streamgraphlibrary(streamgraph)
movies_long %>%
streamgraph("genre", "n", "year") %>%
sg_axis_x(20, "year", "%Y") %>%
sg_fill_brewer("PuOr") %>%
sg_legend(show=TRUE, label="Genres: ")
ol %>%
streamgraph(date = "hour", value = "level_int", key = "octave") %>%
sg_axis_x(1, "month", "%Y-%m") %>%
sg_fill_brewer("Spectral") %>%
#sg_fill_brewer("PuOr") %>%
sg_legend(show=TRUE, label="Octaves: ")
highcharterlibrary(highcharter)
movies_long %>%
hchart("streamgraph", hcaes(year, n, group = genre)) %>%
hc_yAxis(visible = FALSE)
ol %>%
hchart("streamgraph", hcaes(hour_int, level, group = octave))
plotly - skipissue: Add streamgraph - Graphing Library / Plotly.py - Plotly Community Forum
plotly.py doesn’t have a streamgraph trace type or figure factory. To make one, you would need to compute the line locations yourself an then draw it using filled area scatter traces (https://plot.ly/python/filled-area-plots)